package cn.yitun.chat.yitunserverimapicore.business.contact.service.impl;

import cn.yitun.chat.yitunservercommonlib.dataentity.dto.userchat.ChatDataDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.system.user.UserVo;
import cn.yitun.chat.yitunserverimapicore.business.contact.service.ContactService;
import cn.yitun.chat.yitunserverimbase.dao.contact.ContactDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Date 2019-01-20 13:11:09<br>
 * Description
 *
 * @author yitun<br>
 * @version 1.1
 */
@Service
public class ContactServiceImpl implements ContactService {

	@Resource
	private ContactDao contactDAO;

	/**
	 * Date 2019-01-20 18:13:46<br>
	 * Description 获取用户的所有的联系人
	 * @param query
	 * @return
	 * @author yitun<br>
	 * @version 1.1
	 */
	public List<UserVo> getUserDataListByContactCategoryMemberOwnerUserId(ChatDataDto query) {
		List<UserVo> userList = contactDAO.getUserDataListByContactRelationOwnerUserId(query.getOwnerUserId());
		return userList;
	}

	/**
	 * Date 2019-01-20 18:13:46<br>
	 * Description 获取用户的所有的联系人
	 * @param query
	 * @return
	 * @author yitun<br>
	 * @version 1.1
	 */
	public int countUserDataListByContactCategoryMemberOwnerUserId(ChatDataDto query) {
		return contactDAO.countUserDataListByContactCategoryMemberOwnerUserId(query.getOwnerUserId());
	}
}
